package sg.edu.nus.iss.vmcs.store;

import java.util.Iterator;

/*
 * Copyright 2003 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

/**
 *
 *This object is storage for the total number of cans of each Drinks Brand held by the vending machine
 * @version 3.0 5/07/2003
 * @author Olivo Miotto, Pang Ping Li
 */

public class DrinksStore extends Store {
	
	private static DrinksStore instance;
	public static int DESCENDING=3;

	/**
	 * This constructor creates a new instance of the Drinks Store.It creates the required the number of instances of Drinks Store Items.
	 */
	private DrinksStore() {
	}
	
	public static DrinksStore getInstance(){
		if(instance==null)
			instance=new DrinksStore();
		
		return instance;
	}
	
	public Iterator createIterator(int type)
	{
		if(type== NONEMPTY)
			return new NonEmptyQtyIterator(getItems());
		else if(type==NORMALITERATOR)
			return new NormalIterator(getItems());
		else if (type == DESCENDING)
			return new DSDesendingIterator(getItems());
		else
			return null;
	}

}
